package com.woniu40.petai_manager.mapper;

import com.woniu40.petai_manager.entity.GoodsType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface GoodsTypeMapper {
    int insert(GoodsType record);

    List<GoodsType> selectAll();

    @Select("select * from t_goods_type where goods_type_id = #{goodsTypeId} ")
    GoodsType selectById(Integer goodsTypeId);

    @Update("update t_goods_type set goods_type_name = #{goodsTypeName} where goods_type_id = #{goodsTypeId} ")
    int updateGt(GoodsType goodsType);

    int deleteByIds(@Param("idList") List<Integer> idList);

    @Delete("delete from t_goods_type where goods_type_id = #{id} ")
    int deleteById(Integer id);
}